home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / IFC_112 / netscape / application / LayoutManager.java < prev    next >
Encoding:
Text File  |  1999-05-28  |  1.6 KB  |  41 lines  |  [TEXT/CWIE]

  1. // LayoutManager.java
  2. // By Ned Etcode
  3. // Copyright 1996, 1997 Netscape Communications Corp. All rights reserved.
  4.  
  5. package netscape.application;
  6.  
  7. /** Interface for objects interested in acting as a LayoutManager, an object
  8.   * which determines the size and position of a View's subviews. Views
  9.   * automatically call their LayoutManager's <b>layoutView()</b> method from
  10.   * their <b>didSizeBy()</b> method (in response to a resize), so that the
  11.   * LayoutManager can adjust the View's subviews' sizes and positions.  Views
  12.   * also call their LayoutManager's <b>addSubview()</b> and
  13.   * <b>removeSubview()</b> methods as they gain and lose subviews.  In
  14.   * response, a LayoutManager can immediately relayout the View's subviews, or
  15.   * do nothing until all modifications have been made to the View.  In this
  16.   * case, <b>layoutView()</b> must be called explicitly once the modifications
  17.   * have been completed.
  18.   * @see View#setLayoutManager
  19.   */
  20.  
  21. public interface LayoutManager {
  22.     /** Notifies the LayoutManager that <b>aView</b> has been added to the
  23.       * View hierarchy.
  24.       */
  25.     public void addSubview(View aView);
  26.  
  27.     /** Notifies the LayoutManager that <b>aView</b> has been removed from the
  28.       * View hierarchy.
  29.       */
  30.     public void removeSubview(View aView);
  31.  
  32.     /** Requests that the LayoutManager position <b>aView</b>'s subviews.
  33.       * A View calls <b>layoutView()</b> from its <b>didSizeBy()</b> method.
  34.       * <b>deltaWidth</b> and <b>deltaHeight</b> represent the delta between
  35.       * <b>aView</b>'s old size and its current size.
  36.       * @see View#didSizeBy
  37.       */
  38.     public void layoutView(View aView, int deltaWidth, int deltaHeight);
  39. }
  40.  
  41.